// import './assets/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import allGlobalComponent from '@/components'
// 引入Bootstrap CSS
import 'bootstrap/dist/css/bootstrap.min.css'
// 引入Bootstrap JS（bundle版本）
import 'bootstrap/dist/js/bootstrap.bundle.min.js'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import './style/index.css'
import './permission'
import {getHeaders, fileUpload, formatTimeAgo, dateDefaultFormat} from "@/utils";

const app = createApp(App)

app.config.globalProperties.$getHeaders=getHeaders()
app.config.globalProperties.$fileUpload=fileUpload
app.config.globalProperties.$formatTimeAgo=formatTimeAgo
app.config.globalProperties.$timeFormat=dateDefaultFormat

const pinia=createPinia()
pinia.use(piniaPluginPersistedstate)
app.use(pinia)
app.use(allGlobalComponent)
app.use(router)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.mount('#app')
